import java.util.Scanner;

/**
 * @author ShenTuZhiGang
 * @version 1.0.0
 * @email 1600337300@qq.com
 * @date 2021-11-19 20:36
 */
public class Exam2021111902 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine();
        String[] s = scanner.nextLine().split(" ");
        String word = s[0];
        int c = Integer.parseInt(s[1]);
        String[] strs = scanner.nextLine().split(" ");
        if(b==1){
            System.out.println(b);
            System.exit(0);
        }
        int t = 0;
        for (int i = 0; i < 2*b-2; i++) {
            for (int j = 0; j <= i; j++) {
                if(word.equals(strs[j%n])){
                    t++;
                }
            }
        }
        int k = c/t;
        int t0 = c%t;
        if(t0!=0){
            for (int i = 0; i < 2*b-2; i++) {
                for (int j = 0; j <= i; j++) {
                    if(word.equals(strs[j%n])){
                        t0--;
                        if(t0==0){
                            System.out.println(k*(2*b-2)+i);
                        }
                    }
                }
            }
        }else {
            System.out.println(k*(2*b-2));
        }
    }

}
